package base.exception;

/**
 * @Author Fizz Pu
 * @Date 2021/4/13 上午11:27
 * @Version 1.0
 * 失之毫厘，缪之千里！
 */
public class ExceptionTest {
    public static void main(String[] args)
    {
        int result;

        result  =  foo();
        System.out.println(result);     /////////2

        result = bar();
        System.out.println(result);    /////////2
    }

    @SuppressWarnings("finally")
    public static int foo()
    {
        try{
        int a = 5 / 0;
    } catch (Exception e){
        return 1;
    } finally{
        return 2;
    }

    }

    @SuppressWarnings("finally")
    public static int bar()
    {
        try {
            return 1;
        }finally {
            return 2;
        }
    }
}
